import QtQuick 2.15
import QtCharts 2.15

ChartView {
    id: chartView
    title: "雷达图"
    antialiasing: true
    animationOptions: ChartView.AllAnimations
    
    function generateRandomData(count, maxValue) {
        var values = []
        for (var i = 0; i < count; i++) {
            values.push(Math.random() * maxValue)
        }
        return values
    }
    
    Component.onCompleted: {
        var values = generateRandomData(6, 100)
        for (var i = 0; i < values.length; i++) {
            lineSeries.append(i * 60, values[i])
        }
    }
    
    LineSeries {
        id: lineSeries
        name: "Radar"
        axisX: axisX
        axisY: axisY
    }
    
    ValueAxis {
        id: axisX
        min: 0
        max: 360
    }
    
    ValueAxis {
        id: axisY
        min: 0
        max: 100
    }
}

